<template>
    <div>
            <div class="table_serch_labe">
                <el-button
                type="primary"
                size="mini"
                style="height: 30px; margin-top: 5px"
                @click="misGetcont"
                >下载模板</el-button
                >
          </div>
    </div>
</template>

<script>
    export default {
        props:{
           DowUrl:String
        },
        data(){
            return{
               dowUrl:this.DowUrl
            }
        },
        methods:{
            misGetcont(){
               this.ajax({
                   url:this.dowUrl,
                   method:"GET",
                   responseType: "blob",
               }).then((res)=>{
                //    console.log(res.data)
                    if (!res) return;
                let blob = new Blob([res.data],{
                    type: "application/vnd.ms-excel;charset=utf-8",
                });
                let url = window.URL.createObjectURL(blob);
                let aLink = document.createElement("a");
                aLink.style.display = "none";
                aLink.href = url;
                aLink.setAttribute("download", `模板.xlsx`); // 下载的文件
                document.body.appendChild(aLink);
                aLink.click();
                document.body.removeChild(aLink);
                window.URL.revokeObjectURL(url);
              })
            }
        }
    }
</script>

<style  scoped>

</style>